package com.springcloud.alibaba.handler;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CommExpectionHandler {

    public static String fallback(String id, Throwable e) {
        log.error("出现业务异常");
        return "-1:业务异常";
    }

    public static String handlerException(String id, BlockException e) {
        log.error("触发限流");
        return "-2:触发限流";
    }

}
